import 'package:dio/dio.dart';
import 'package:sainbainu/common/http/http.dart';

class LoginApi {
  /// 临时登录
  Future<Map<String, dynamic>> tempLogin(Map data) async {
    Response res = await Http.post(
      '/api/login/tempLogin',
      data: data,
    );
    return res.data;
  }

  /// 一键登录
  Future<Map<String, dynamic>> jpushLogin(Map data) async {
    Response res = await Http.post(
      '/api/login/jpush_login_token_verify',
      data: data,
    );
    return res.data;
  }

  /// 短信验证码登录
  Future<Map<String, dynamic>> smsCodeLogin(Map data) async {
    Response res = await Http.post(
      '/api/login/sms',
      data: data,
    );
    return res.data;
  }

  /// 密码登录
  Future<Map<String, dynamic>> passwordLogin(Map data) async {
    Response res = await Http.post(
      '/api/login/passwd',
      data: data,
    );
    return res.data;
  }

  /// 微信登录
  Future<Map<String, dynamic>> wechatLogin(Map data) async {
    Response res = await Http.post(
      '/api/login/wx_account',
      data: data,
    );
    return res.data;
  }

  /// apple 登录
  Future<Map<String, dynamic>> appleLogin(Map data) async {
    Response res = await Http.post(
      '/api/login/apple',
      data: data,
    );
    return res.data;
  }
}
